package org.example.Util;

import org.example.core.pojo.User;

public class UserUtil {
    static ThreadLocal<User> UserThreadLocal = new ThreadLocal<>();

    /**
     * 获取用户
     * @return
     */
    public static User getUser(){
        return UserThreadLocal.get();
    }
    /**
     * 设置用户
     */
    public static void setUser(User user){
        UserThreadLocal.set(user);
    }
    /**
     * 移除用户
     */
    public static void rmUser(){
        UserThreadLocal.remove();
    }
}
